import { routes } from './routes'
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom'


const renderView = (routes: any) => {
	return routes.map((v: any, i: number) => {
		return <Route key={i} path={ v.path } element={ v.element }>
			{ v.children && renderView(v.children) }
		</Route>
	})
}

export default () => {
	return (
		<Router>
			<Routes>
				{
					renderView(routes)
				}
			</Routes>
		</Router>
	)
}